<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite) ? (include $this->template('common/header', TEMPLATE_INCLUDEPATH)) : (include template('common/header', TEMPLATE_INCLUDEPATH));?>
<div class="page superpage_<?php  echo $do;?>" id="superpage_<?php  echo $do;?>_<?php  echo $act;?>">
	<div class="content">
		<!--head-->
		<div id="hd" style="<?php  if(isset($creditmall_list)) { ?>height:12rem;<?php  } else { ?>height: 11rem;<?php  } ?> background: url(<?php  if($this->setting['base']['topimg']) { ?><?php  echo tomedia($this->setting['base']['topimg'])?><?php  } else { ?><?php  echo $user['big_avatar'];?><?php  } ?>)  no-repeat center;background-size: cover;">
			<div id="drag" class="drag"></div>
			<div class="row">
				<div class="col-50 integral_wrap">
					<span class="my_integral">我的<?php  echo $credit_title;?></span>
					<span class="my_integral_num"><?php  echo $user['credit'];?></span>
				</div>
				<div class="col-50 rule_wrap">
					<?php  if($this->setting['base']['sign_rule'] != '') { ?>
					<a href="#" class="sign_rule">签到规则</a>
					<?php  } ?>
				</div>
			</div>
			<div class="sign_btn_wrap">
				<?php  if(isset($sign_log['today_rank'])) { ?>
				<div class="my_integral_info">
					<div class="row no-gutter">
						<div class="col-25">
							<img src="<?php  echo tomedia($user['avatar'])?>" alt="" onerror="this.src='resource/images/heading.jpg'"/>
						</div>
						<div class="col-75">
							<span>已连续签到<span class="highlight"><?php  echo $sign_log['continue_total'];?></span>天，累计签到<span class="highlight"><?php  echo $sign_log['total'];?></span>天</span>
							<?php  if($beat_percent == 100 ) { ?>
							<span>你击败了<span class="highlight">99%</span>的用户，继续加油吧</span>
							<?php  } else { ?>
							<span>你击败了<span class="highlight"><?php  echo $beat_percent;?>%</span>的用户，继续加油吧</span>
							<?php  } ?>
						</div>
					</div>
				</div>
				<?php  } else { ?>
				<form method="post" action="<?php  echo $_W['siteurl'];?>">
					<input type="hidden" name="token" value="<?php  echo $_W['token'];?>">
					<a href="#" class="btn_3d btn_3d_up external">点击签到</a>
				</form>
				<?php  } ?>
			</div>

			<?php  if(isset($creditmall_list)) { ?>
			<div class="exchange_info">
				<div class="row no-gutter">
					<div id="creditmall_order" class="col-75">
						<?php  if(is_array($creditmall_list)) { foreach($creditmall_list as $item) { ?>
						<li>
							<?php  echo $item['nickname'];?> 花费<?php  if($item['price']>0) { ?><?php  echo $item['credit'];?><?php  echo $item['credit_title'];?>+<?php  echo $item['price'];?>元<?php  } else { ?><?php  echo $item['credit'];?><?php  echo $item['credit_title'];?><?php  } ?> 兑换<?php  echo trim($item['title'])?>
						</li>
						<?php  } } ?>
					</div>
					<div class="col-25">
						<a class="external" href="<?php  echo $_W['siteroot'];?>app/index.php?i=<?php  echo $_W['uniacid'];?>&c=entry&do=home&m=superman_creditmall">
							去兑换<span class="icon icon-right"></span>
						</a>
					</div>
				</div>
			</div>
			<?php  } ?>
		</div>
		<!--body-->
		<div id="bd">
			<div class="rank_wrap">
				<div class="buttons-tab">
					<a href="<?php  echo $this->createMobileUrl('sign', array('rid'=>$this->rid, 'rank'=>'today', '__from' => $_GPC['__from']))?>" class="rank_link <?php  if($rank_type=='today') { ?>active<?php  } ?> button external">今日排行榜</a>
					<a href="<?php  echo $this->createMobileUrl('sign', array('rid'=>$this->rid, 'rank'=>'all', '__from' => $_GPC['__from']))?>" class="rank_link <?php  if($rank_type=='all') { ?>active<?php  } ?> button external">总排行榜</a>
					<a href="<?php  echo $this->createMobileUrl('sign', array('rid'=>$this->rid, 'rank'=>'credit', '__from' => $_GPC['__from']))?>" class="rank_link <?php  if($rank_type=='credit') { ?>active<?php  } ?> button external">积分排行榜</a>
				</div>
				<div class="rank_list_wrap">
					<div class="tabs">
						<div class="tab active">
							<div class="list-block">
								<div class="list-group">
									<ul>
										<li>
											<div class="item-content">
												<div class="item-inner <?php  if($rank_type=='today') { ?>column4<?php  } else { ?>column3<?php  } ?>">
													<div class="item-title">排名</div>
													<div class="item-title">昵称</div>
													<?php  if($rank_type=='today') { ?>
													<div class="item-title">奖励</div>
													<div class="item-title">签到时间</div>
													<?php  } else if($rank_type=='all') { ?>
													<div class="item-title">签到总天数</div>
													<?php  } else if($rank_type=='credit') { ?>
													<div class="item-title"><?php  echo $credit_title;?></div>
													<?php  } ?>
												</div>
											</div>
										</li>
										<?php  if($list) { ?>
										<?php  if(is_array($list)) { foreach($list as $li) { ?>
										<li>
											<div class="item-content">
												<div class="item-inner <?php  if($rank_type=='today') { ?>column4<?php  } else { ?>column3<?php  } ?>">
													<div class="item_ranking">
														<span class="rank<?php  echo $li['index'];?>"><?php  echo $li['index'];?></span>
													</div>
													<div class="item-title">
														<img src="<?php  echo tomedia($li['avatar']);?>" onerror="this.src='resource/images/heading.jpg'" class="sign_avatar">
														<?php  if($li['nickname']!='') { ?>
														<?php  echo $li['nickname'];?>
														<?php  } else { ?>
														<?php  echo $li['uid'];?>
														<?php  } ?>
													</div>
													<?php  if($rank_type=='today') { ?>
													<div class="item-title"><?php  echo $li['reward'];?></div>
													<div class="item-title"><?php  echo $li['time'];?></div>
													<?php  } else if($rank_type=='all') { ?>
													<div class="item-title"><?php  echo $li['total'];?></div>
													<?php  } else if($rank_type=='credit') { ?>
													<div class="item-title"><?php  echo $li['credit'];?></div>
													<?php  } ?>
												</div>
											</div>
										</li>
										<?php  } } ?>
										<?php  } ?>
									</ul>
									<?php  if(!$list) { ?>
									<p style="text-align: center;color: #ccc; font-size: .7rem;">还没有数据，快去抢签到~~~</p>
									<?php  } ?>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<?php  if(isset($_GPC['__from']) && in_array($_GPC['__from'], array('superman_creditmall','superman_mall'))) { ?>
	<div class="sign_back">
		<?php  if($_GPC['__from'] == 'superman_creditmall') { ?>
		<a class="external" href="<?php  echo $_W['siteroot'];?>app/index.php?i=<?php  echo $_W['uniacid'];?>&c=entry&do=task&type=2&m=superman_creditmall"><span class="icon icon-home"></span></a>
		<?php  } else if($_GPC['__from'] == 'superman_mall') { ?>
		<a class="external" href="<?php  echo $_W['siteroot'];?>app/index.php?i=<?php  echo $_W['uniacid'];?>&c=entry&do=home&m=superman_mall"><span class="icon icon-home"></span></a>
		<?php  } ?>
	</div>
	<?php  } ?>
	<!--<div class="invite_btn_wrap">
		<a href="javascript:void(0);" class="button button-fill button-warning button-big">
			<span class="icon icon-share"></span>
			点击邀请好友
		</a>
	</div>-->
</div>
<?php  if($this->setting['base']['sign_rule'] != '') { ?>
<div class="popup sign_popup">
	<div class="content-block">
		<i class="iconfont close-popup">&#xe600;</i>
		<?php  echo htmlspecialchars_decode($this->setting['base']['sign_rule']);?>
	</div>
</div>
<?php  } ?>
<?php (!empty($this) && $this instanceof WeModuleSite) ? (include $this->template('common/footer', TEMPLATE_INCLUDEPATH)) : (include template('common/footer', TEMPLATE_INCLUDEPATH));?>